package first_day;


public class FizzBuzzWhizz {

    private static final String FIZZ = "Fizz";
    private static final String BUZZ = "Buzz";
    private static final String WHIZZ = "Whizz";
    private static final String FIZZ_BUZZ = "FizzBuzz";
    private static final String BUZZ_WHIZZ = "BuzzWhizz";
    private static final String FIZZ_WHIZZ = "FizzWhizz";
    private static final String FIZZ_BUZZ_WHIZZ = "FizzBuzzWhizz";

    public String getNumber(int number) {
        String numberStr = String.valueOf(number);
        if (numberStr.contains("7")) {
            if (numberStr.contains("5") && number % 3 == 0) {
                return FIZZ;
            }
            if (number % 5 == 0) {
                return WHIZZ;
            }
        }
        if (numberStr.contains("5")) {
            if (number % 7 == 0) {
                return BUZZ_WHIZZ;
            } else if (number % 5 == 0){
                return BUZZ;
            }
        }
        if (numberStr.contains("3")) {
            return FIZZ;
        }
        if (number % 3 == 0 && number % 5 == 0 && number % 7 == 0) {
            return FIZZ_BUZZ_WHIZZ;
        }
        if (number % 5 == 0 && number % 7 == 0) {
            return BUZZ_WHIZZ;
        }
        if (number % 3 == 0 && number % 5 == 0) {
            return FIZZ_BUZZ;
        }
        if (number % 3 == 0 && number % 7 == 0) {
            return FIZZ_WHIZZ;
        }
        if (number % 7 == 0) {
            return WHIZZ;
        }
        if (number % 5 == 0) {
            return BUZZ;
        }
        if (number % 3 == 0) {
            return FIZZ;
        }
        return numberStr;
    }
}
